﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using DE.Sdc.SharePoint.Common.Deployment;


namespace DE.Sdc.SharePoint.Common.ContentStructureImporterConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                Console.WriteLine("Verwendung:");
                Console.WriteLine("   Parameter 1: Pfad zur ContentStructure XML-Datei");
                Console.WriteLine("   Parameter 2: Url zum SharePoint Web");
            }
            else
            {
                Console.WriteLine("Import gestartet!");
                string contentStructureDescriptionXmlPath = args[0];
                string webUrl = args[1];
                try
                {
                    var importer = new ContentStructureImporter(contentStructureDescriptionXmlPath, webUrl);
                    importer.Execute();
                    Console.WriteLine("Import erfolgreich!");
                    Thread.Sleep(2000);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    Console.ReadKey();
                }
            }
        }
    }
}